class Animail {
    public String name = "hh";
    public int age;

    public Animail(String name, int age) {
        this.name = name;
        this.age = age;
       // System.out.println("animail构造对象被执行。。。");
    }

   /* {
        System.out.println("animail实例化对象被执行。。。");
    }
    static {
        System.out.println("animail静态对象被执行。。。");
    }*/
    public void eat() {
        System.out.println(this.name + "吃东西");
    }
}
class Cat extends Animail {

    public String color;

    public Cat(String name, int age, String color) {
        super(name, age);
        this.color = color;
    }
   public void eat() {
        System.out.println(this.name + "正在吃猫粮");
    }

    public void mmm() {

        System.out.println(this.name + "喵喵喵");
    }
}
class Dog extends Animail {

    public String band;

    public Dog(String name, int age, String band) {
        super(name, age);
        this.band = band;
       // System.out.println("Dog构造对象被执行。。。");

    }
    public void eat() {
        System.out.println(this.name + "正在吃狗粮");
    }

    public  void www() {
        System.out.println(this.name + "汪汪汪");
    }
  /*  {
        System.out.println("Dog实例化对象被执行。。。");
    }
    static {
        System.out.println("Dog静态对象被执行。。。");
    }*/

}
/*
public class Test {
    public static void fun(Animail animail) {
        animail.eat();

    }

    public static void main(String[] args) {
      */
/*  Dog dog = new Dog("旺财",12,"黄毛");
        fun(dog);*//*

       // Dog dog = new Dog("旺财",12,"黄毛");
        Animail animail =  new Dog("旺财",12,"黄毛");
         Dog dog = (Dog)animail;
         dog.eat();
      //  animail.eat();


        System.out.println("--------------------------");
       */
/* Cat cat = new Cat("小白",23,"bule");
        fun(cat);*//*


        Cat cat = new Cat("小白",23,"bule");
        Animail animail12 =  new Cat("小白",23,"bule");
        animail12.eat();

     */
/*   dog.www();
        dog.eat();*//*

    }
}
*/



/*
class B {
    public int Func() {
        System.out.print("B");
        return 0;
    }
}
class D extends B {
    @Override
    public int Func() {
        System.out.print("D");
        return 0;
    }
}
public class Test {
    public static void main(String[] args) {
        B a = new B();
        B b = new D();
        a.Func();
        b.Func();
    }
}*/

/*
public class Test{

    private String name = "Person";

    int age=0;

}

public class Child extends Test {

    public String grade;

    public static void main(String[] args) {

        Test p = new Child();

        System.out.println(p.name);

    }
}
*/
